﻿Imports BUS, DTO
Public Class frmLayThongTinDocGiaTuFileExcel

    Private Sub btndoc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndoc.Click
        Dim ofdl As New OpenFileDialog()
        ofdl.Filter = "File Excel 97-2003 *.xls | *.xls | File excel 2010 *.xlsx | *.xlsx | All file *.* | *.*"
        ofdl.FilterIndex = 2
        If ofdl.ShowDialog() = DialogResult.OK Then
            Dim path As String = ofdl.FileName
            Dim sql As String = "select * from [Sheet1$]"
            Dim docgiaBus As New DocGiaBUS()
            Dim ds As New DataSet
            ds = docgiaBus.DocFileExcel(sql, path)
            dtgvdssach.DataSource = ds.Tables("Sheet1")
        End If

    End Sub

    Private Sub btnluu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnluu.Click
        Dim dt As New DataTable()
        dt = dtgvdssach.DataSource
        Dim docgiaBus As New DocGiaBUS()
        Dim kq As Integer
        kq = docgiaBus.LuuExcelvaoCSDL(dt)
    End Sub

    Private Sub frmLayThongTinDocGiaTuFileExcel_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class